n = int(input())
students = []
sum = []
for i in range(n):
    student = list(input().split())
    sum = int(student[1]) + int(student[2]) + int(student[3])
    student.append(sum)
    sum.append(sum)
    students.append(student)
for i in students:
    sumx= i[len(i) - 1]
    if max(sum) == sumx:
        print("%s %s %s %s" % (i[0],i[1], i[2],i[3]))
#先储存学生的信息，再创建变量储存学生成绩总和，进行比较，输出成绩最高者